#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include "filetree.h"

QT_BEGIN_NAMESPACE
class QAction;
class QLabel;
QT_END_NAMESPACE

class MainWindow : public QMainWindow
{
    Q_OBJECT

private slots:
    void open();
    void close();
    void openDllFile();
    void showSearchDialog();
    void showOptionsDialog();
    void about();
    void selectChanged(int pos, int len);

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();

    void loadFile(const QString &fileName);

private:
    void init();
    void createActions();
    void createMenus();
    void createStatusBar();
    void setTitle(const QString &fileName);

private:
    FileTree *m_fileTree;
    QString m_dllPath;

    QAction *m_openAct;
    QAction *m_dllAct;
    QAction *m_closeAct;
    QAction *m_exitAct;
    QAction *m_aboutAct;
    QAction *m_aboutQtAct;
    QAction *m_optionsAct;
    QAction *m_copyAct;
    QAction *m_findAct;
    QAction *m_findNextAct;
    QAction *m_findLastAct;

    QMenu *m_fileMenu;
    QMenu *m_editMenu;
    QMenu *m_helpMenu;

    QLabel *lbAddress, *lbSize;
};
#endif // MAINWINDOW_H
